.class Lcom/peptalk/client/lbs/android/Wifi;
.super Ljava/lang/Object;
.source "Wifi.java"


# instance fields
.field public mac:Ljava/lang/String;

.field public rssi:I

.field public ssid:Ljava/lang/String;


# direct methods
.method constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 13
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 14
    iput-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    .line 15
    iput-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    .line 16
    const/high16 v0, -0x8000

    iput v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->rssi:I

    .line 13
    return-void
.end method


# virtual methods
.method public json()Lorg/json/JSONObject;
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    .prologue
    .line 43
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    .line 44
    .local v0, wifi:Lorg/json/JSONObject;
    iget-object v1, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    if-eqz v1, :cond_0

    .line 45
    const-string v1, "mac"

    iget-object v2, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 46
    const-string v1, "ssid"

    iget-object v2, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 47
    const-string v1, "rssi"

    iget v2, p0, Lcom/peptalk/client/lbs/android/Wifi;->rssi:I

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    move-object v1, v0

    .line 50
    :goto_0
    return-object v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 19
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "mac="

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v1, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "; "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 20
    const-string v1, "ssid="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "; "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 21
    const-string v1, "rssi="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lcom/peptalk/client/lbs/android/Wifi;->rssi:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "; "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "\n"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 19
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public write(Ljava/io/ByteArrayOutputStream;)V
    .locals 3
    .parameter "baos"

    .prologue
    const/4 v2, 0x0

    .line 25
    iget-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 27
    iget-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    array-length v0, v0

    invoke-virtual {p1, v0}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 29
    iget-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    iget-object v1, p0, Lcom/peptalk/client/lbs/android/Wifi;->mac:Ljava/lang/String;

    invoke-virtual {v1}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    array-length v1, v1

    invoke-virtual {p1, v0, v2, v1}, Ljava/io/ByteArrayOutputStream;->write([BII)V

    .line 31
    iget-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    array-length v0, v0

    invoke-virtual {p1, v0}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 33
    iget-object v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    iget-object v1, p0, Lcom/peptalk/client/lbs/android/Wifi;->ssid:Ljava/lang/String;

    invoke-virtual {v1}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    array-length v1, v1

    invoke-virtual {p1, v0, v2, v1}, Ljava/io/ByteArrayOutputStream;->write([BII)V

    .line 35
    iget v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->rssi:I

    shr-int/lit8 v0, v0, 0x18

    int-to-byte v0, v0

    and-int/lit16 v0, v0, 0xff

    invoke-virtual {p1, v0}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 36
    iget v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->rssi:I

    shr-int/lit8 v0, v0, 0x10

    int-to-byte v0, v0

    and-int/lit16 v0, v0, 0xff

    invoke-virtual {p1, v0}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 37
    iget v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->rssi:I

    shr-int/lit8 v0, v0, 0x8

    int-to-byte v0, v0

    and-int/lit16 v0, v0, 0xff

    invoke-virtual {p1, v0}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 38
    iget v0, p0, Lcom/peptalk/client/lbs/android/Wifi;->rssi:I

    and-int/lit16 v0, v0, 0xff

    int-to-byte v0, v0

    invoke-virtual {p1, v0}, Ljava/io/ByteArrayOutputStream;->write(I)V

    .line 40
    :cond_0
    return-void
.end method
